package cn.asiontang.db;

import android.content.Context;

import java.util.List;

public class KeyValueEntity extends BaseEntity
{
    public static class Dao extends BaseEntityDao<KeyValueEntity>
    {
        public Dao(final Context context)
        {
            super(context);
        }

        public List<KeyValueEntity> getEntitys(final int sqlResId, final Object... args)
        {
            return super.getList(sqlResId, args);
        }

        public List<KeyValueEntity> getEntitys(final String sql)
        {
            return super.getList(sql);
        }
    }

    public KeyValueEntity()
    {
    }

    public KeyValueEntity(final String key, final String value)
    {
        this.setKey(key);
        this.setValue(value);
    }

    public String getKey()
    {
        return this.getValue("KEY");
    }

    public String getValue()
    {
        return this.getValue("VALUE");
    }

    public void setKey(final String value)
    {
        this.setValue("KEY", value);
    }

    public void setValue(final String value)
    {
        this.setValue("VALUE", value);
    }

    @Override
    public String toString()
    {
        return this.getValue();
    }
}
